﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Customer Order List</title>
    <link rel="stylesheet" type="text/css" href="style/common.css" />
    <link rel="stylesheet" type="text/css" media="print" href="style/print.css" />
    <link rel="stylesheet" type="text/css" href="style/jquery-ui.css" />

    <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="jquery-ui.js"></script>
    <script type="text/javascript" src="js/sarissa/sarissa-compressed.js"></script>
    <script type="text/javascript" src="js/sarissa/sarissa_ieemu_xpath-compressed.js"></script>
    <script type="text/javascript" src="js/jquery.xslTransform.packed.js"></script>
    <script type="text/javascript">
        $(function () {

            var soldto = "";
            var last = "";

            var query = location.search; // ?soldto=adi&last=2015-03-01
            query = query.replace("?", "");
            var params = query.split("&");
            for (i = 0; i < params.length; i++) {
                var values = params[i].split("=");
                if (values.length > 1) {
                    if (values[0].toLowerCase() == "soldto") {
                        soldto = values[1];
                    } else if (values[0].toLowerCase() == "last") {
                        last = values[1];
                    }
                }
            }
            //console.log("Soldto: " + soldto);
            //console.log("Last: " + last);

            $("#content").getTransform(
        	    'customer.xsl',
        	    'nisan.xml', {
        		    params: {
        		        customer: soldto.toUpperCase(),
        		        last: last
        		}
            });

        });
    </script>
</head>
<body>
    <div id="content"></div>
</body>
</html>